package test3_11;

import java.util.Arrays;
import java.util.Scanner;

public class Test_splittingCustomization {
    public static void main(String[] args) {
        /*
        输入一个数组 自定义拆分为两个数组 第一个数组内存放个数也为自定义
         */
        System.out.println("输入数组长度：");
        Scanner sc = new Scanner(System.in);
        int l = sc.nextInt();
        int[] v = new int[l];
        System.out.println("输入前一个数组存放的长度：");
        int l1 = sc.nextInt();
        int[] v1 = new int[l1];
        //初始化后一个数组的长度
        int l2 = l - l1;
        int[] v2 = new int[l2];

        //输入v数组中数据
        System.out.println("输入v数组的元素：");
        for (int i = 0; i < l; i++) {
            v[i] = sc.nextInt();
        }
        System.out.println(Arrays.toString(v));

        for (int i = 0; i < l1; i++) {
            v1[i] = v[i];
        }
        System.out.println(Arrays.toString(v1));

        for (int i = l1; i < l; i++) {
            v2[i-l1] = v[i];
        }
        System.out.println(Arrays.toString(v2));
    }
}
